package com.microtf.inscription.jpa.entity;

import lombok.Data;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.util.Date;
import java.util.UUID;

/**
 * 用户预注册信息
 *
 * @author guliuzhong
 */
@Entity
@Data
@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {"userName"})})
public class UserRegister {
    /**
     * 主键
     */
    @Id
    @SequenceGenerator(sequenceName = "user_register_id_seq", name = "genUserRegisterId", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "genUserRegisterId")
    Long registerId;
    /**
     * 邮件
     */
    String userName;
    /**
     * 邮件
     */
    String email;
    /**
     * 电话
     */
    String tel;
    /**
     * 激活key
     */
    @Column(length = 40, nullable = false)
    UUID activeKey;
    /**
     * 创建时间
     */
    Date createDate;
    /**
     * 激活时间
     */
    Date activeDate;
    /**
     * 是否已激活
     */
    Boolean isActive;
}